// chrono standard header
#ifndef _CHRONO_
#define _CHRONO_
#include <limits>
#include <ratio>
#include <utility>
#include <time.h>
#include <Dinkum/threads/xtimec.h>

_STD_BEGIN
namespace chrono {
	// CLASS TEMPLATE treat_as_floating_point
template<class _Rep>
	struct treat_as_floating_point
		: is_floating_point<_Rep>
	{	// tests for floating-point type
	};

	// CLASS TEMPLATE duration_values
template<class _Rep>
	struct duration_values
	{	// gets arithmetic properties of a type
	static _CONST_FUN _Rep zero()
		{	// get zero value
		return (_Rep(0));
		}

	static _CONST_FUN _Rep (min)()
		{	// get smallest value
		return (numeric_limits<_Rep>::lowest());
		}

	static _CONST_FUN _Rep (max)()
		{	// get largest value
		return ((numeric_limits<_Rep>::max)());
		}
	};

	// CLASS TEMPLATE _Is_ratio
template<class _Ty>
	struct _Is_ratio
	{	// test for ratio type
	static const bool value = false;
	};

template<intmax_t _R1,
	intmax_t _R2>
	struct _Is_ratio<ratio<_R1, _R2> >
	{	// test for ratio type
	static const bool value = true;
	};

	// CLASS TEMPLATE duration
template<class _Rep,
	class _Period = ratio<1> >
	class duration;

template<class _Ty>
	struct _Is_duration
		: false_type
	{	// tests for duration
	};

template<class _Rep,
	class _Period>
	struct _Is_duration<duration<_Rep, _Period> >
		: true_type
	{	// tests for duration
	};

template<class _To,
	class _Rep,
	class _Period> inline
	_CONST_FUN typename enable_if<_Is_duration<_To>::value,
		_To>::type
		duration_cast(const duration<_Rep, _Period>&);

template<class _Rep,
	class _Period>
	class duration
	{	// represents a time duration
public:
	typedef duration<_Rep, _Period> _Myt;
	typedef _Rep rep;
	typedef _Period period;

	_STATIC_ASSERT2(!_Is_duration<_Rep>::value,
		"duration can't have duration as first template argument");
	_STATIC_ASSERT2(_Is_ratio<_Period>::value,
		"period not an instance of std::ratio");
	_STATIC_ASSERT2(0 < _Period::num,
		"period negative or zero");

	_CONST_FUN duration() = default;

 #if _HAS_NEW_SFINAE
	template<class _Rep2,
		class = typename enable_if<is_convertible<_Rep2, _Rep>::value
			&& (treat_as_floating_point<_Rep>::value
				|| !treat_as_floating_point<_Rep2>::value),
			void>::type>
		_CONST_FUN explicit duration(const _Rep2& _Val)
			: _MyRep(static_cast<_Rep>(_Val))
		{	// construct from representation
		}

	template<class _Rep2,
		class _Period2,
		class = typename enable_if<treat_as_floating_point<_Rep>::value

 #if _HAS_TEMPLATE_ALIAS
			|| (_Ratio_divide_sfinae<_Period2, _Period>::den == 1

 #else /* _HAS_TEMPLATE_ALIAS */
			|| (ratio_divide<_Period2, _Period>::type::den == 1
 #endif /* _HAS_TEMPLATE_ALIAS */

				&& !treat_as_floating_point<_Rep2>::value),
			void>::type>
		_CONST_FUN duration(const duration<_Rep2, _Period2>& _Dur)
			: _MyRep(duration_cast<_Myt>(_Dur).count())
		{	// construct from a duration
		}

 #else /* _HAS_NEW_SFINAE */
	template<class _Rep2>
		_CONST_FUN explicit duration(const _Rep2& _Val,
			typename enable_if<is_convertible<_Rep2, _Rep>::value
				&& (treat_as_floating_point<_Rep>::value
					|| !treat_as_floating_point<_Rep2>::value),
				void>::type ** = 0)
			: _MyRep(static_cast<_Rep>(_Val))
		{	// construct from representation
		_STATIC_ASSERT2(_Is_ratio<_Period>::value,
			"period not an instance of std::ratio");
		_STATIC_ASSERT2(0 < _Period::num,
			"duration negative or zero");
		}

	template<class _Rep2,
		class _Period2>
		_CONST_FUN duration(const duration<_Rep2, _Period2>& _Dur,
			typename enable_if<treat_as_floating_point<_Rep>::value
				|| (ratio_divide<_Period2, _Period>::type::den == 1
					&& !treat_as_floating_point<_Rep2>::value),
				void>::type ** = 0)
		: _MyRep(duration_cast<_Myt>(_Dur).count())
		{	// construct from a duration
		}
 #endif /* _HAS_NEW_SFINAE */

	_CONST_FUN _Rep count() const
		{	// get stored rep
		return (_MyRep);
		}

	_CONST_FUN _Myt operator+() const
		{	// get value
		return (*this);
		}

	_CONST_FUN _Myt operator-() const
		{	// get negated value
		return (_Myt(0 - _MyRep));
		}

	_Myt& operator++()
		{	// increment rep
		++_MyRep;
		return (*this);
		}

	_Myt operator++(int)
		{	// postincrement rep
		return (_Myt(_MyRep++));
		}

	_Myt& operator--()
		{	// decrement rep
		--_MyRep;
		return (*this);
		}

	_Myt operator--(int)
		{	// postdecrement rep
		return (_Myt(_MyRep--));
		}

	_Myt& operator+=(const _Myt& _Right)
		{	// add _Right to rep
		_MyRep += _Right._MyRep;
		return (*this);
		}

	_Myt& operator-=(const _Myt& _Right)
		{	// subtract _Right from rep
		_MyRep -= _Right._MyRep;
		return (*this);
		}

	_Myt& operator*=(const _Rep& _Right)
		{	// multiply rep by _Right
		_MyRep *= _Right;
		return (*this);
		}

	_Myt& operator/=(const _Rep& _Right)
		{	// divide rep by _Right
		_MyRep /= _Right;
		return (*this);
		}

	_Myt& operator%=(const _Rep& _Right)
		{	// modulus rep by _Right
		_MyRep %= _Right;
		return (*this);
		}

	_Myt& operator%=(const _Myt& _Right)
		{	// modulus rep by _Right
		_MyRep %= _Right.count();
		return (*this);
		}

	static _CONST_FUN _Myt zero()
		{	// get zero value
		return (_Myt(duration_values<_Rep>::zero()));
		}

	static _CONST_FUN _Myt (min)()
		{	// get minimum value
		return (_Myt((duration_values<_Rep>::min)()));
		}
	static _CONST_FUN _Myt (max)()
		{	// get maximum value
		return (_Myt((duration_values<_Rep>::max)()));
		}

private:
	_Rep _MyRep;	// the stored rep
	};

template<class _Clock,
	class _Duration = typename _Clock::duration>
	class time_point
	{	// represents a point in time
public:
	typedef _Clock clock;
	typedef _Duration duration;
	typedef typename _Duration::rep rep;
	typedef typename _Duration::period period;

	_STATIC_ASSERT2(_Is_duration<_Duration>::value,
		"duration must be an instance of std::duration");

	_CONST_FUN time_point()
		: _MyDur(_Duration::zero())
		{	// construct with value epoch
		}

	_CONST_FUN explicit time_point(const _Duration& _Other)
		: _MyDur(_Other)
		{	// construct from a duration
		}

 #if _HAS_NEW_SFINAE
	template<class _Duration2,
		class = typename enable_if<is_convertible<_Duration2,
			_Duration>::value,
			void>::type>
		_CONST_FUN time_point(const time_point<_Clock, _Duration2>& _Tp)
		: _MyDur(_Tp.time_since_epoch())
		{	// construct from another duration
		}

 #else /* _HAS_NEW_SFINAE */
	template<class _Duration2>
		_CONST_FUN time_point(const time_point<_Clock, _Duration2>& _Tp,
			typename enable_if<is_convertible<_Duration2, _Duration>::value,
			void>::type ** = 0)
		: _MyDur(_Tp.time_since_epoch())
		{	// construct from another duration
		}
 #endif /* _HAS_NEW_SFINAE */

	_CONST_FUN _Duration time_since_epoch() const
		{	// get duration from epoch
		return (_MyDur);
		}

	time_point& operator+=(const _Duration& _Dur)
		{	// increment by duration
		_MyDur += _Dur;
		return (*this);
		}

	time_point& operator-=(const _Duration& _Dur)
		{	// decrement by duration
		_MyDur -= _Dur;
		return (*this);
		}

	static _CONST_FUN time_point (min)()
		{	// get minimum time point
		return (time_point((_Duration::min)()));
		}
	static _CONST_FUN time_point (max)()
		{	// get maximum time point
		return (time_point((_Duration::max)()));
		}

private:
	_Duration _MyDur;	// duration since the epoch
	};
}	// namespace chrono

	// CLASS TEMPLATE _Lcm (LEAST COMMON MULTIPLE)
template<intmax_t _Ax,
	intmax_t _Bx>
	struct _Lcm
	{	/* compute least common multiple of _Ax and _Bx */
	static const intmax_t _Gx = _Gcd<_Ax, _Bx>::value;
	static const intmax_t value = (_Ax / _Gx) * _Bx;
	};

	// CLASS TEMPLATE common_type SPECIALIZATIONS
template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2>
	struct common_type<
		chrono::duration<_Rep1, _Period1>,
		chrono::duration<_Rep2, _Period2> >
	{	// common type of two durations
	typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
		ratio<_Gcd<_Period1::num, _Period2::num>::value,
			_Lcm<_Period1::den, _Period2::den>::value> > type;
	};

template<class _Clock,
	class _Duration1,
	class _Duration2>
	struct common_type<
		chrono::time_point<_Clock, _Duration1>,
		chrono::time_point<_Clock, _Duration2> >
	{	// common type of two time points
	typedef chrono::time_point<
		_Clock, typename common_type<_Duration1, _Duration2>::type> type;
	};

namespace chrono {
	// duration ARITHMETIC
template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN typename common_type<
		duration<_Rep1, _Period1>,
		duration<_Rep2, _Period2> >::type
		operator+(
			const duration<_Rep1, _Period1>& _Left,
			const duration<_Rep2, _Period2>& _Right)
	{	// add two durations
	typedef typename common_type<
		duration<_Rep1, _Period1>,
		duration<_Rep2, _Period2> >::type _CD;
	return (_CD(_CD(_Left).count() + _CD(_Right).count()));
		}

template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN typename common_type<
		duration<_Rep1, _Period1>,
		duration<_Rep2, _Period2> >::type
		operator-(
			const duration<_Rep1, _Period1>& _Left,
			const duration<_Rep2, _Period2>& _Right)
	{	// subtract two durations
	typedef typename common_type<
		duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _CD;
	return (_CD(_CD(_Left).count() - _CD(_Right).count()));
	}

template<class _Rep1,
	class _Period1,
	class _Rep2> inline
	_CONST_FUN typename enable_if<is_convertible<_Rep2,
		typename common_type<_Rep1, _Rep2>::type>::value,
		duration<typename common_type<_Rep1, _Rep2>::type, _Period1> >::type
		operator*(
			const duration<_Rep1, _Period1>& _Left,
			const _Rep2& _Right)
	{	// multiply duration by rep
	typedef typename common_type<_Rep1, _Rep2>::type _CR;
	typedef duration<_CR, _Period1> _CD;
	return (_CD(_CD(_Left).count() * _Right));
	}

template<class _Rep1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN typename enable_if<is_convertible<_Rep1,
		typename common_type<_Rep1, _Rep2>::type>::value,
		duration<typename common_type<_Rep1, _Rep2>::type, _Period2> >::type
		operator*(
			const _Rep1& _Left,
			const duration<_Rep2, _Period2>& _Right)
	{	// multiply rep by duration
	return (_Right * _Left);
	}

template<class _CR,
	class _Period1,
	class _Rep2,
	bool = is_convertible<_Rep2, _CR>::value>
	struct _Duration_div_mod1
	{	// return type for duration / rep and duration % rep
	typedef duration<_CR, _Period1> type;
	};

template<class _CR,
	class _Period1,
	class _Rep2>
	struct _Duration_div_mod1<_CR, _Period1, _Rep2, false>
	{	// no return type
	};

template<class _Rep1,
	class _Period1,
	class _Rep2,
	bool = _Is_duration<_Rep2>::value>
	struct _Duration_div_mod
	{	// no return type
	};

template<class _Rep1,
	class _Period1,
	class _Rep2>
	struct _Duration_div_mod<_Rep1, _Period1, _Rep2, false>
		: _Duration_div_mod1<typename common_type<_Rep1, _Rep2>::type,
			_Period1, _Rep2>
	{	// return type for duration / rep and duration % rep
	};

template<class _Rep1,
	class _Period1,
	class _Rep2> inline
	typename _Duration_div_mod<_Rep1, _Period1, _Rep2>::type
		_CONST_FUN operator/(
			const duration<_Rep1, _Period1>& _Left,
			const _Rep2& _Right)
	{	// divide duration by rep
	typedef typename common_type<_Rep1, _Rep2>::type _CR;
	typedef duration<_CR, _Period1> _CD;
	return (_CD(_CD(_Left).count() / _Right));
	}

template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN typename common_type<_Rep1, _Rep2>::type
		operator/(
			const duration<_Rep1, _Period1>& _Left,
			const duration<_Rep2, _Period2>& _Right)
	{	// divide duration by duration
	typedef typename common_type<
		duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _CD;
	return (_CD(_Left).count() / _CD(_Right).count());
	}

template<class _Rep1,
	class _Period1,
	class _Rep2> inline
	_CONST_FUN typename _Duration_div_mod<_Rep1, _Period1, _Rep2>::type
		operator%(
			const duration<_Rep1, _Period1>& _Left,
			const _Rep2& _Right)
	{	// divide duration by rep
	typedef typename common_type<_Rep1, _Rep2>::type _CR;
	typedef duration<_CR, _Period1> _CD;
	return (_CD(_CD(_Left).count() % _Right));
	}

template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN typename common_type<
		duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
		operator%(
			const duration<_Rep1, _Period1>& _Left,
			const duration<_Rep2, _Period2>& _Right)
	{	// divide duration by duration
	typedef typename common_type<
		duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _CD;
	return (_CD(_CD(_Left).count() % _CD(_Right).count()));
	}

	// duration COMPARISONS
template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN bool operator==(
		const duration<_Rep1, _Period1>& _Left,
		const duration<_Rep2, _Period2>& _Right)
	{	// test if duration == duration
	typedef typename common_type<
		duration<_Rep1, _Period1>,
		duration<_Rep2, _Period2> >::type _CT;
	return (_CT(_Left).count() == _CT(_Right).count());
	}

template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN bool operator!=(
		const duration<_Rep1, _Period1>& _Left,
		const duration<_Rep2, _Period2>& _Right)
	{	// test if duration != duration
	return (!(_Left == _Right));
	}

template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN bool operator<(
		const duration<_Rep1, _Period1>& _Left,
		const duration<_Rep2, _Period2>& _Right)
	{	// test if duration < duration
	typedef typename common_type<
		duration<_Rep1, _Period1>,
		duration<_Rep2, _Period2> >::type _CT;
	return (_CT(_Left).count() < _CT(_Right).count());
	}

template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN bool operator<=(
		const duration<_Rep1, _Period1>& _Left,
		const duration<_Rep2, _Period2>& _Right)
	{	// test if duration <= duration
	return (!(_Right < _Left));
	}

template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN bool operator>(
		const duration<_Rep1, _Period1>& _Left,
		const duration<_Rep2, _Period2>& _Right)
	{	// test if duration > duration
	return (_Right < _Left);
	}

template<class _Rep1,
	class _Period1,
	class _Rep2,
	class _Period2> inline
	_CONST_FUN bool operator>=(
		const duration<_Rep1, _Period1>& _Left,
		const duration<_Rep2, _Period2>& _Right)
	{	// test if duration >= duration
	return (!(_Left < _Right));
	}

	// duration_cast
template<class _To,
	class _Rep,
	class _Period> inline
	_CONST_FUN typename enable_if<_Is_duration<_To>::value,
		_To>::type
		duration_cast(const duration<_Rep, _Period>& _Dur)
	{	// convert duration to another duration
 #if _HAS_TEMPLATE_ALIAS
	typedef ratio_divide<_Period, typename _To::period> _CF;

 #else /* _HAS_TEMPLATE_ALIAS */
	typedef typename ratio_divide<_Period, typename _To::period>::type _CF;
 #endif /* _HAS_TEMPLATE_ALIAS */

	typedef typename _To::rep _ToRep;
	typedef typename common_type<_ToRep, _Rep, intmax_t>::type _CR;
	return (_CF::num == 1 && _CF::den == 1
			? _To(static_cast<_ToRep>(_Dur.count()))
		: _CF::num != 1 && _CF::den == 1
			? _To(static_cast<_ToRep>(
				static_cast<_CR>(
					_Dur.count()) * static_cast<_CR>(_CF::num)))
		: _CF::num == 1 && _CF::den != 1
			? _To(static_cast<_ToRep>(
				static_cast<_CR>(_Dur.count())
					/ static_cast<_CR>(_CF::den)))
		: _To(static_cast<_ToRep>(
			static_cast<_CR>(_Dur.count()) * static_cast<_CR>(_CF::num)
				/ static_cast<_CR>(_CF::den))));
	}

	// duration TYPEDEFS
typedef duration<long long, nano> nanoseconds;
typedef duration<long long, micro> microseconds;
typedef duration<long long, milli> milliseconds;
typedef duration<long long> seconds;
typedef duration<int, ratio<60> > minutes;
typedef duration<int, ratio<3600> > hours;

	// time_point ARITHMETIC
template<class _Clock,
	class _Duration,
	class _Rep,
	class _Period> inline
	_CONST_FUN time_point<_Clock,
		typename common_type<_Duration, duration<_Rep, _Period> >::type>
		operator+(
			const time_point<_Clock, _Duration>& _Left,
			const duration<_Rep, _Period>& _Right)
	{	// add duration to time_point
	typedef time_point<_Clock, typename common_type<
		_Duration, duration<_Rep, _Period> >::type> _RT;
	return (_RT(_Left.time_since_epoch() + _Right));
	}

template<class _Rep,
	class _Period,
	class _Clock,
	class _Duration> inline
	_CONST_FUN time_point<_Clock,
		typename common_type<duration<_Rep, _Period>, _Duration>::type>
		operator+(
			const duration<_Rep, _Period>& _Left,
			const time_point<_Clock, _Duration>& _Right)
	{	// add time_point to duration
	return (_Right + _Left);
	}

template<class _Clock,
	class _Duration,
	class _Rep,
	class _Period> inline
	_CONST_FUN time_point<_Clock,
		typename common_type<_Duration, duration<_Rep, _Period> >::type>
		operator-(
			const time_point<_Clock, _Duration>& _Left,
			const duration<_Rep, _Period>& _Right)
	{	// subtract duration from time_point
	return (_Left + (-_Right));
	}

template<class _Clock,
	class _Duration1,
	class _Duration2> inline
	_CONST_FUN typename common_type<_Duration1, _Duration2>::type
		operator-(
			const time_point<_Clock, _Duration1>& _Left,
			const time_point<_Clock, _Duration2>& _Right)
	{	// add time_point to time_point
	return (_Left.time_since_epoch() - _Right.time_since_epoch());
	}

	// time_point COMPARISONS
template<class _Clock,
	class _Duration1,
	class _Duration2> inline
	_CONST_FUN bool operator==(
		const time_point<_Clock, _Duration1>& _Left,
		const time_point<_Clock, _Duration2>& _Right)
	{	// test for time_point == time_point
	return (_Left.time_since_epoch() == _Right.time_since_epoch());
	}

template<class _Clock,
	class _Duration1,
	class _Duration2> inline
	_CONST_FUN bool operator!=(
		const time_point<_Clock, _Duration1>& _Left,
		const time_point<_Clock, _Duration2>& _Right)
	{	// test for time_point != time_point
	return (!(_Left == _Right));
	}

template<class _Clock,
	class _Duration1,
	class _Duration2> inline
	_CONST_FUN bool operator<(
		const time_point<_Clock, _Duration1>& _Left,
		const time_point<_Clock, _Duration2>& _Right)
	{	// test for time_point < time_point
	return (_Left.time_since_epoch() < _Right.time_since_epoch());
	}

template<class _Clock,
	class _Duration1,
	class _Duration2> inline
	_CONST_FUN bool operator<=(
		const time_point<_Clock, _Duration1>& _Left,
		const time_point<_Clock, _Duration2>& _Right)
	{	// test for time_point <= time_point
	return (!(_Right < _Left));
	}

template<class _Clock,
	class _Duration1,
	class _Duration2> inline
	_CONST_FUN bool operator>(
		const time_point<_Clock, _Duration1>& _Left,
		const time_point<_Clock, _Duration2>& _Right)
	{	// test for time_point > time_point
	return (_Right < _Left);
	}

template<class _Clock,
	class _Duration1,
	class _Duration2> inline
	_CONST_FUN bool operator>=(
		const time_point<_Clock, _Duration1>& _Left,
		const time_point<_Clock, _Duration2>& _Right)
	{	// test for time_point >= time_point
	return (!(_Left < _Right));
	}

	// time_point_cast
template<class _To,
	class _Clock,
	class _Duration> inline
	_CONST_FUN typename enable_if<_Is_duration<_To>::value,
		time_point<_Clock, _To> >::type
		time_point_cast(const time_point<_Clock, _Duration>& _Time)
	{	// convert time_point to duration
	return (time_point<_Clock, _To>(
		duration_cast<_To>(_Time.time_since_epoch())));
	}

	// CLOCKS
struct system_clock
	{	// wraps system clock
	typedef long long rep;

 #if _HAS_TEMPLATE_ALIAS
	typedef ratio_multiply<ratio<_XTIME_NSECS_PER_TICK, 1>, nano> period;

 #else /* _HAS_TEMPLATE_ALIAS */
	typedef ratio_multiply<ratio<_XTIME_NSECS_PER_TICK, 1>, nano>
		::type period;
 #endif /* _HAS_TEMPLATE_ALIAS */

	typedef chrono::duration<rep, period> duration;
	typedef chrono::time_point<system_clock> time_point;
	static _CONST_DATA bool is_steady = false;
	static _CONST_DATA bool is_monotonic = false;	// retained

	static time_point now() _NOEXCEPT
		{	// get current time
		return (time_point(duration(_Xtime_get_ticks())));
		}

	static time_t to_time_t(const time_point& _Time) _NOEXCEPT
		{	// convert to time_t
		return ((time_t)(_Time.time_since_epoch().count()
			/ _XTIME_TICKS_PER_TIME_T));
		}

	static time_point from_time_t(time_t _Tm) _NOEXCEPT
		{	// convert from time_t
		return (time_point(duration(_Tm * _XTIME_TICKS_PER_TIME_T)));
		}
	};

class steady_clock
	: public system_clock
	{	// wraps monotonic clock
public:
	static const bool is_monotonic = true;	// retained
	static _CONST_DATA bool is_steady = true;
	};

typedef steady_clock monotonic_clock;	// retained
typedef system_clock high_resolution_clock;
}	// namespace chrono

	// HELPERS
template<class _Rep,
	class _Period> inline
	xtime _To_xtime(const chrono::duration<_Rep, _Period>& _Rel_time)
	{	// convert duration to xtime
	xtime _Xt;
	if (_Rel_time <= chrono::duration<_Rep, _Period>::zero())
		{	// negative or zero relative time, return zero
		_Xt.sec = 0;
		_Xt.nsec = 0;
		}
	else
		{	// positive relative time, convert
		chrono::nanoseconds _T0 =
			chrono::system_clock::now().time_since_epoch();
		_T0 += _Rel_time;
		_Xt.sec = chrono::duration_cast<chrono::seconds>(_T0).count();
		_T0 -= chrono::seconds(_Xt.sec);
		_Xt.nsec = (long)_T0.count();
		}
	return (_Xt);
	}
_STD_END
#endif /* _CHRONO */

/*
 * Copyright (c) by P.J. Plauger. All rights reserved.
 * Consult your license regarding permissions and restrictions.
V6.50:1422 */
